import requests

# 例如：
# url = 'https://i0.hdslb.com/bfs/ai_subtitle/prod/1939080131621681c53353d772816f02d494c3f99b9b47ee'
url = '这里填你的url地址'
data = requests.get(url=url)
json = eval(data.text)['body']

def getTime(seconds):
    m, s = divmod(seconds, 60)
    h, m = divmod(m, 60)
    res = "%02d:%02d:%02d,%.0f" % (h, m, s,round(seconds-int(seconds),4)*1000)
    return res

fp = open('res.srt','w',encoding='utf-8')
for d in json:
    print(d)
    num = d['sid']
    start = d['from']
    end = d['to']
    msg = d['content']
    fp.write("{}\n{} --> {}\n{}\n\n".format(num,getTime(start),getTime(end),msg))
fp.close()
